package com.whl.project.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import com.whl.mybatis.BaseMapper;
import com.whl.project.entity.RoleEntity;

public interface RoleMapper extends BaseMapper<RoleEntity> {
	
	@Select("select *  from role where `code` = #{code}")
	@ResultMap("baseResultMap")
	public RoleEntity selectByCode(String code);
	
	@Insert("insert into user_role(user_id,role_id) values(#{userId},#{roleId})")
	public void actionRole(@Param("userId") Long userId,@Param("roleId") Long roleId);

}
